#ifndef MAINAPPLICATION_H
#define MAINAPPLICATION_H

//!Includes
#include "../tasks/ReportTask.h"
#include "../tasks/ControlRobotTask.h"
#include "../tasks/TrackingTask.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
//!Defines


//!Global Variables



//!Global Functions



namespace apps
{

/**
 * class MainApplication
 *
 *
 * PROJECT:
 *
 */


class MainApplication
{
public:

	//!Enums



	//!Constructors/Destructors

	/**
	 * Empty Constructor
	 */
	MainApplication (int argc,char **argv);

	/**
	 * Empty Destructor
	 */
	virtual ~MainApplication ( );

	//!Public Attributes



	//!Public Accessor Methods



	//!Public Methods

	/**
	 * This function implements the main state machine.
	 */
	void Execute ( );


protected:

	//!Protected Attributes



	//!Protected Methods



private:

	//!Private Attributes
	tasks::ReportTask *m_pReport;
	tasks::ControlRobotTask *m_pControlRobot;
	tasks::TrackingTask *m_pTraking;
	ArClientBase m_Client;
	ArClientBase *m_pClient;
	std::vector <algorithms::Target> m_TargetVector;
	std::vector <CvPoint> m_VectorSignal1;
	std::vector <CvPoint> m_VectorSignal2;
	std::vector <CvPoint> m_VectorSignal3;
	std::vector <algorithms::Target> m_LastTargetVector;
	int m_iCount;
	bool  m_bAlign;
	int  m_iModeControl;
	int  m_iModeGetImage;
	//!Private Methods
	void AchieveTarget ( );
	bool SearchTarget ( );
	void PushVector (int val);
	void AproximationAndReturn ( );
	void initAttributes ( );


};

};

#endif
